<template>
  <el-menu
    :collapse="props.isCollapse"
    active-text-color="#ffd04b"
    background-color="#545c64"
    class="el-menu-vertical-demo"
    :default-active="defaultActive"
    router
    text-color="#fff"
  >
    <template v-if="props.menuList && props.menuList.length > 0">
      <SidebarItem v-for="item in props.menuList" :key="item.path" :meun-item="item" />
    </template>
  </el-menu>
</template>

<script setup lang="ts">
import { defineProps } from 'vue';
import SidebarItem from './SidebarItem.vue';
import useWatchRoute from '@/hooks/useWatchRoute';

const props = defineProps<{ menuList: Array<any> | null; isCollapse: boolean }>();

const { defaultActive } = useWatchRoute();
</script>

<style scoped></style>
